package com.kun.mapper;

import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.kun.entity.SysRole;
import com.kun.note.DataScope;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author kun.li
 */
@Mapper
@DataScope(methods = {"selectPage"})
public interface SysRoleMapper extends BaseMapper<SysRole> {
    @InterceptorIgnore(tenantLine = "true")
    @Select("select t2.* from sys_user_role t1 join sys_role t2 on t1.role_id=t2.role_id where t1.user_id=#{userId}  ")
    List<SysRole> selectSysRole(@Param("userId") String userId);

}
